package com.hist;

import com.hist.pojo.Hello;
import com.hist.service.Impl.UserServiceImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @auther Ren Gaoshuai
 * @date 2021-04-05 15:11
 **/
public class Mytest {
    public static void main(String[] args) {
        //获得spring上下文对象
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");

        //通过id从spring容器中获取该对象
        UserServiceImpl serviceUser = (UserServiceImpl) context.getBean("serviceUser");

       serviceUser.getUser();
    }
}
